package com.hzit.bj1804.dianweb.service;

import com.github.pagehelper.PageInfo;
import com.hzit.bj1804.dian.entity.Orderinfo;
import com.hzit.bj1804.dian.entity.Productinfo;
import com.hzit.bj1804.dian.vo.OrderdetailsOrderinfoProductinfo;
import com.hzit.bj1804.dian.vo.OrderinfoMemberpay;
import com.hzit.bj1804.dian.vo.PageRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;

@FeignClient(value = "wutong-client",fallback =OrderinfoImpl.class)
public interface OrderinfoService {
    //显示所有订单表中的订单数据
    @RequestMapping("allList")
    PageInfo<OrderdetailsOrderinfoProductinfo> all(@RequestBody PageRequest pageRequest);

    //下单时间查询订单
    @RequestMapping("time")
    PageInfo<Orderinfo> selectTime(@RequestBody PageRequest pageRequest,@RequestParam("ordertime") String ordertime);

    //根据会员名称搜索订单
    @RequestMapping("cardholdername")
    List<OrderinfoMemberpay> selectName(@RequestParam("cardholdername") String cardholdername);

    //修改订单状态
    @RequestMapping("stutes")
    int updateStutes(@RequestBody Orderinfo orderinfo);
    //根据id查询商品信息
    @RequestMapping("shangping")
    Productinfo selectShangPing(@RequestParam("productid") int productid);
    //查询所有商品信息
    @RequestMapping("shangpinAll")
    List<Productinfo> selectAlls();
    //根据id查询所有订单三表联合查询信息
    @RequestMapping("selectByIdXinXi")
    PageInfo<OrderdetailsOrderinfoProductinfo> selectByIdXinXi(@RequestBody PageRequest pageRequest,@RequestParam("orderid") int orderid);
}
